/*
 * Config.h
 *
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#define PROC_THREADS_NUM 3

// Dimensione del frame acquisito mediante Kinect.
#define FRAME_WIDTH 640
#define FRAME_HEIGHT 480

// Larghezza dell'angolo visivo orizzontale della Kinect.
#define HORIZONTAL_FOV 57.000f

// Dimensione del frame per il processing.
#define PROC_FRAME_WIDTH 640
#define PROC_FRAME_HEIGHT 300

// Dimensione del rettangolo per il taglio dell'immagine.
#define CUT_RECT_X 0
#define CUT_RECT_Y FRAME_HEIGHT - PROC_FRAME_HEIGHT
#define SCALE_FACTOR HORIZONTAL_FOV / PROC_FRAME_WIDTH

// Valori per la sogliatura per il riconoscimento della palla.
#define BALL_H_MIN_UP_0 0
#define BALL_S_MIN_UP_1 186
#define BALL_V_MIN_UP_2 63
#define BALL_H_MAX_UP_0 11
#define BALL_S_MAX_UP_1 255
#define BALL_V_MAX_UP_2 255

#define BALL_H_MIN_LOW_0 167
#define BALL_S_MIN_LOW_1 117
#define BALL_V_MIN_LOW_2 131
#define BALL_H_MAX_LOW_0 180
#define BALL_S_MAX_LOW_1 194
#define BALL_V_MAX_LOW_2 255

// Valori per la sogliatura per il riconoscimento dell'obiettivo (la porta).
#define GOAL_H_MIN_0 102
#define GOAL_S_MIN_1 52
#define GOAL_V_MIN_2 39
#define GOAL_H_MAX_0 124
#define GOAL_S_MAX_1 243
#define GOAL_V_MAX_2 151

// Valori per la sogliatura per il riconoscimento degli ostacoli.
#define OBSTACLE_H_MIN_0 17
#define OBSTACLE_S_MIN_1 53
#define OBSTACLE_V_MIN_2 140
#define OBSTACLE_H_MAX_0 35
#define OBSTACLE_S_MAX_1 209
#define OBSTACLE_V_MAX_2 187

// Dimensione del kernel per l'operatore morfologico di erosione.
#define BALL_EROSION_SIZE 1
#define GOAL_EROSION_SIZE 1
#define OBSTACLE_EROSION_SIZE 2

// Dimensione del kernel per l'operatore morfologico di dilatazione.
#define BALL_DILATATION_SIZE 10
#define GOAL_DILATATION_SIZE 5
#define OBSTACLE_DILATATION_SIZE 10

// Parametri per la blob detection.
#define BALL_MIN_AREA 200
#define BALL_MAX_AREA 1000000
#define BALL_BLOB_COLOR 255
#define BALL_MIN_DISTANCE_BETWEEN_BLOBS 100
#define GOAL_MIN_AREA 2000
#define GOAL_MAX_AREA PROC_FRAME_WIDTH * PROC_FRAME_HEIGHT
#define GOAL_BLOB_COLOR 255
#define GOAL_MIN_DISTANCE_BETWEEN_BLOBS 50
#define OBSTACLE_MIN_AREA 700
#define OBSTACLE_MAX_AREA PROC_FRAME_WIDTH * PROC_FRAME_HEIGHT
#define OBSTACLE_BLOB_COLOR 255
#define OBSTACLE_MIN_DISTANCE_BETWEEN_BLOBS 250

// Parametri per il robot.
#define MAX_VELOCITY 150
#define MINIMUM_DISTANCE 400

// Parametri per il wandering.
#define DEGREE_DELTA 15
#define SAME_DIRECTION 1
#define CHANGE_DIRECTION -1
#define AVOIDING_SPEED 100
#define CRUISE_SPEED 200
#define AVOIDING_DISTANCE 450
#define MAX_VEL 400
#define MINIMUM_DISTANCE_TO_GOAL 100

#endif /* CONFIG_H_ */
